<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>

<form:form modelAttribute="flight" action="searchFlight">
	
	

	<div class="section"><span class="errors"> <form:errors path="*" /> </span>
	<br/>
	
	<h2>Search Flight Schedules</h2>

	<fieldset>

	<div class="field">
	<div class="label">Departing City:</div>
	<div class="input"><form:select path="departingCity" itemLabel="name" itemValue="id" items="${cityList}" /></div>
	</div>

	<div class="field">
	<div class="label">Destination City:</div>
	<div class="input"><form:select path="destinationCity" itemLabel="name" itemValue="id" items="${cityList}" /></div>
	</div>


	<div class="field">
	<div class="label">Departure Date: </div>
	<div class="input"><form:input path="departureDate" /> </div> 
	<script type="text/javascript">
	Spring.addDecoration(new Spring.ElementDecoration( {
		elementId : "departureDate",
		widgetType : "dijit.form.DateTextBox",
		widgetAttrs : { required : true, datePattern : "MM-dd-yyyy"}  	}));
	</script>	
	</div>


	<div class="field">
	<div class="label">Departure Time: </div>
	<div class="input"><form:input path="departureTime" maxlength="15" />	</div>
	<script type="text/javascript">
	Spring.addDecoration(new Spring.ElementDecoration( {
		elementId : "departureTime",
		widgetType : "dijit.form.ValidationTextBox",
		widgetAttrs : { required : false, regExp:"[0-9]{1,2}:[0-9]{2}"  }}));
	</script>
	</div>





	<div class="buttonGroup">
	<input type="submit" id="btnFindFlights" value="Find Flights" />	
	</div>
	
	</fieldset>


	</div>
</form:form>